<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Booking extends Model
{
    protected $fillable = [
        'room_id', 'check_in', 'room_id', 'check_out', 'customer_id'
    ];

    public function availability(){
        return $this->morphOne(Availability::class, 'rentable');
    }

    public function payment(){
        return $this->morphOne(Payment::class, 'rentable');
    }

    public function customer(){
        return $this->belongsTo(Customer::class);
    }

    public function room(){
        return $this->belongsTo(Room::class);
    }

    public function comment(){
        return $this->hasOne(Comment::class);
    }
}
